﻿namespace WinForms.ControlList.Sales
{
    using Bll.Sales;
    using Bll.Stock;
    using Bll.Systems;
    using Library;
    using Model.Sales;
    using Model.Systems;
    using PublicStaticClass.UIControl;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.Properties;

    public class FrmTestDunkList : WindowBase
    {
        private Button btn_Check;
        private Button btn_ChengDan;
        private Button btnAddNew;
        private Button btnChongAll;
        private Button btnDelele;
        private Button btnSelectAll;
        private string[] checkPopIsUse = new string[4];
        private string[] CheckPopName = new string[] { "NewTestDunk", "EditTestDunk", "DeleteTestDunk", "CheckTestDunk" };
        private DataGridViewCheckBoxColumn chk_chkItem;
        private IContainer components = null;
        private DataGridViewTextBoxColumn CreateTime;
        private DataGridView DataGridList;
        private DataGridViewTextBoxColumn dgChainNum;
        private DataGridViewTextBoxColumn dgCheckMan;
        private DataGridViewTextBoxColumn dgCheckTime;
        private DataGridViewTextBoxColumn dgCreateTime;
        private DataGridViewTextBoxColumn dgGuestId;
        private DataGridViewTextBoxColumn dgGuestName;
        private DataGridViewTextBoxColumn dgIsCheck;
        private DataGridViewTextBoxColumn dgIsSucceed;
        private DataGridViewTextBoxColumn dgPrices;
        private DataGridViewTextBoxColumn dgRemark;
        private DataGridViewTextBoxColumn dgTestDunkId;
        private DataGridViewTextBoxColumn dgTestDunkNum;
        private DataGridViewTextBoxColumn dgUserId;
        private DataGridViewTextBoxColumn GuestName;
        private DataGridViewImageColumn imgDelete;
        private DataGridViewImageColumn imgEdit;
        private DataGridViewTextBoxColumn IsCheck;
        private DataGridViewTextBoxColumn IsSucceed;
        private Label label1;
        private Label lblWhere;
        private Navigator navigator_Page;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Top;
        private Panel pan_TopJianGe;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel1;
        private Panel panel10;
        private Panel panel11;
        private Panel panel12;
        private Panel panel13;
        private Panel panel14;
        private Panel panel15;
        private Panel panel2;
        private Panel panel24;
        private Panel panel3;
        private Panel panel4;
        private Panel panel5;
        private Panel panel6;
        private Panel panel7;
        private Panel panel8;
        private Panel panel9;
        private PictureBox pic_Help;
        private DataGridViewTextBoxColumn Prices;
        public FrmPrompt prom = null;
        private DataGridViewTextBoxColumn TestDunkId;
        private DataGridViewTextBoxColumn TestDunkNum;
        private DataGridViewTextBoxColumn UserId;

        public FrmTestDunkList()
        {
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        }

        private void btn_Check_Click(object sender, EventArgs e)
        {
            string[] strArray = this.GetSelectId(0).Split(new char[] { ',' });
            foreach (string str in strArray)
            {
                if (str != "")
                {
                    TestDunkEnt model = TestDunkBll.GetModel(int.Parse(str));
                    if (model.IsCheck == 0)
                    {
                        if (StockBll.TestDunkOutPut(str) == 2)
                        {
                            MessageBox.Show("库存不够,请检查", "提示", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            return;
                        }
                        model.IsCheck = 1;
                        UserEnt loginUser = PublicAppliction.LoginUser;
                        model.CheckMan = loginUser.UserId;
                        model.CheckTime = DateTime.Now;
                        TestDunkBll.IsCheckAndOutStock(model);
                    }
                }
            }
            this.prom = new FrmPrompt(true, "试泡信息已确认!");
            this.prom.Show();
            this.DatePageReadLoad();
        }

        private void btn_ChengDan_Click(object sender, EventArgs e)
        {
            string[] strArray = this.GetSelectId(0).Split(new char[] { ',' });
            foreach (string str in strArray)
            {
                if (str != "")
                {
                    TestDunkEnt model = TestDunkBll.GetModel(int.Parse(str));
                    if (model.IsSucceed == 0)
                    {
                        model.IsSucceed = 1;
                    }
                    else
                    {
                        model.IsSucceed = 0;
                    }
                    TestDunkBll.Update(model);
                }
            }
            this.DatePageReadLoad();
        }

        private void btnAddNew_Click(object sender, EventArgs e)
        {
            FrmTestDunkAdd add = new FrmTestDunkAdd();
            if (DialogResult.OK == add.ShowDialog())
            {
                this.DatePageReadLoad();
            }
            add.Dispose();
        }

        private void btnChongAll_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.DataGridList.Rows.Count; i++)
            {
                this.DataGridList.Rows[i].Cells[0].Value = "False";
            }
        }

        private void btnDelele_Click(object sender, EventArgs e)
        {
            try
            {
                string str = "";
                for (int i = 0; i < this.DataGridList.Rows.Count; i++)
                {
                    if (this.DataGridList.Rows[i].Cells[0].FormattedValue.ToString() == "True")
                    {
                        TestDunkBll.Delete(int.Parse(this.DataGridList.Rows[i].Cells[1].Value.ToString()));
                        str = str + this.DataGridList.Rows[i].Cells[1].Value + ",";
                    }
                }
                this.DatePageReadLoad();
                WorkLogBll.AddNewLog("删除试泡信息 编号:" + str, "", PublicAppliction.LoginUser);
            }
            catch (Exception exception)
            {
                ErrorsBll.NewException(exception, PublicAppliction.LoginUser);
            }
        }

        private void btnSelectAll_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < this.DataGridList.Rows.Count; i++)
            {
                if (this.DataGridList.Rows[i].Cells[0].FormattedValue.ToString() == "True")
                {
                    this.DataGridList.Rows[i].Cells[0].Value = "False";
                }
                else
                {
                    this.DataGridList.Rows[i].Cells[0].Value = "True";
                }
            }
        }

        protected void DataGrid_bind()
        {
            try
            {
                DataTable dt = new DataTable();
                int pageCurrent = this.navigator_Page.PageCurrent;
                if (this.lblWhere.Text != "")
                {
                    dt = TestDunkBll.GetPageList(PublicAppliction.PageCount, pageCurrent, this.lblWhere.Text);
                }
                else
                {
                    dt = TestDunkBll.GetPageList(PublicAppliction.PageCount, pageCurrent, "");
                }
                int num2 = GetTableColCount.ReturnTableColCount("Systems", "T_TestDunk", this.lblWhere.Text);
                this.DataGridList.AutoGenerateColumns = false;
                this.DataZhuanHuan(ref dt);
                this.DataGridList.DataSource = dt;
                this.navigator_Page.DataSource = dt;
                this.navigator_Page.RowCount = num2;
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }

        private void DataGridList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (e.ColumnIndex == this.DataGridList.Columns["imgEdit"].Index)
                {
                    FrmTestDunkEdit edit = new FrmTestDunkEdit(int.Parse(this.DataGridList.Rows[e.RowIndex].Cells[1].Value.ToString()));
                    if (DialogResult.OK == edit.ShowDialog())
                    {
                        this.DatePageReadLoad();
                    }
                    edit.Dispose();
                }
                else if (e.ColumnIndex == this.DataGridList.Columns["imgDelete"].Index)
                {
                    string s = this.DataGridList.Rows[e.RowIndex].Cells[1].Value.ToString();
                    if (DialogResult.OK == MessageBox.Show("您确定要删除这条记录?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk))
                    {
                        TestDunkBll.Delete(int.Parse(s));
                        WorkLogBll.AddNewLog("删除试泡信息 编号:" + s, "", PublicAppliction.LoginUser);
                    }
                    this.DatePageReadLoad();
                }
            }
        }

        private void DataGridList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                FrmTestDunkVeiw veiw = new FrmTestDunkVeiw(int.Parse(this.DataGridList.Rows[e.RowIndex].Cells[1].Value.ToString()));
                if (DialogResult.OK == veiw.ShowDialog())
                {
                    this.DataGrid_bind();
                }
                veiw.Dispose();
            }
        }

        protected void DataZhuanHuan(ref DataTable dt)
        {
            dt.Columns["UserId"].ColumnName = "UserId1";
            dt.Columns["IsSucceed"].ColumnName = "IsSucceed1";
            dt.Columns["IsCheck"].ColumnName = "IsCheck1";
            dt.Columns.Add("UserId");
            dt.Columns.Add("IsSucceed");
            dt.Columns.Add("IsCheck");
            foreach (DataRow row in dt.Rows)
            {
                DataRow[] rowArray = PublicAppliction.UserDt.Select("userid=" + row["UserId1"].ToString());
                if (rowArray.Length > 0)
                {
                    row["UserId"] = rowArray[0]["UserName"].ToString();
                }
                if (row["IsSucceed1"].ToString() == "1")
                {
                    row["IsSucceed"] = "已成单";
                }
                else
                {
                    row["IsSucceed"] = "未成单";
                }
                if (row["IsCheck1"].ToString() == "1")
                {
                    row["IsCheck"] = "已确认";
                }
                else
                {
                    row["IsCheck"] = "未确认";
                }
            }
            dt.Columns.Remove("UserId1");
            dt.Columns.Remove("IsSucceed1");
            dt.Columns.Remove("IsCheck1");
        }

        private void DatePageReadLoad()
        {
            this.DataGrid_bind();
            this.InitPage();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmTestDunkList_Load(object sender, EventArgs e)
        {
            this.DataGrid_bind();
            this.InitPage();
            base.CheckPopedom(this, this.DataGridList, this.CheckPopName, this.checkPopIsUse);
            if ((ConfigBll.GetModel(1).IsUseMeUse != 1) && (this.checkPopIsUse[3] != "1"))
            {
                this.panel4.Visible = false;
            }
            if (PublicAppliction.configEnt.IsUseHelp == 1)
            {
                this.pic_Help.Visible = true;
            }
            else
            {
                this.pic_Help.Visible = false;
            }
            this.DataGridList.ClearSelection();
        }

        private string GetSelectId(int types)
        {
            string str;
            int num;
            if (types == 0)
            {
                str = "";
                for (num = 0; num < this.DataGridList.Rows.Count; num++)
                {
                    if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                    {
                        str = str + this.DataGridList.Rows[num].Cells[1].Value + ",";
                    }
                }
                return str;
            }
            int num2 = 0;
            str = "";
            for (num = 0; num < this.DataGridList.Rows.Count; num++)
            {
                if (this.DataGridList.Rows[num].Cells[0].FormattedValue.ToString() == "True")
                {
                    str = str + this.DataGridList.Rows[num].Cells[1].Value + ",";
                    num2++;
                }
            }
            if (num2 > 1)
            {
                MessageBox.Show("只能选择一项", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                return "";
            }
            return str.Replace(",", "");
        }

        private void InitializeComponent()
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            DataGridViewCellStyle style12 = new DataGridViewCellStyle();
            this.panel1 = new Panel();
            this.panel24 = new Panel();
            this.pic_Help = new PictureBox();
            this.panel5 = new Panel();
            this.btnAddNew = new Button();
            this.panel6 = new Panel();
            this.btnSelectAll = new Button();
            this.panel14 = new Panel();
            this.btnChongAll = new Button();
            this.panel15 = new Panel();
            this.btnDelele = new Button();
            this.panel7 = new Panel();
            this.btn_Check = new Button();
            this.panel4 = new Panel();
            this.btn_ChengDan = new Button();
            this.panel3 = new Panel();
            this.panel2 = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.DataGridList = new DataGridView();
            this.chk_chkItem = new DataGridViewCheckBoxColumn();
            this.TestDunkId = new DataGridViewTextBoxColumn();
            this.TestDunkNum = new DataGridViewTextBoxColumn();
            this.GuestName = new DataGridViewTextBoxColumn();
            this.UserId = new DataGridViewTextBoxColumn();
            this.CreateTime = new DataGridViewTextBoxColumn();
            this.Prices = new DataGridViewTextBoxColumn();
            this.IsSucceed = new DataGridViewTextBoxColumn();
            this.IsCheck = new DataGridViewTextBoxColumn();
            this.imgEdit = new DataGridViewImageColumn();
            this.imgDelete = new DataGridViewImageColumn();
            this.panel13 = new Panel();
            this.panel10 = new Panel();
            this.panel12 = new Panel();
            this.lblWhere = new Label();
            this.panel11 = new Panel();
            this.navigator_Page = new Navigator();
            this.panel9 = new Panel();
            this.panel8 = new Panel();
            this.pan_TopJianGe = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_DockLeft = new Panel();
            this.label1 = new Label();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.panel1.SuspendLayout();
            this.panel24.SuspendLayout();
            ((ISupportInitialize) this.pic_Help).BeginInit();
            this.panel5.SuspendLayout();
            this.panel6.SuspendLayout();
            this.panel14.SuspendLayout();
            this.panel15.SuspendLayout();
            this.panel7.SuspendLayout();
            this.panel4.SuspendLayout();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            ((ISupportInitialize) this.DataGridList).BeginInit();
            this.panel10.SuspendLayout();
            this.panel12.SuspendLayout();
            this.panel11.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.panel1.BackColor = Color.FromArgb(0xf6, 0xf6, 0xf6);
            this.panel1.Controls.Add(this.panel24);
            this.panel1.Controls.Add(this.panel5);
            this.panel1.Controls.Add(this.panel6);
            this.panel1.Controls.Add(this.panel14);
            this.panel1.Controls.Add(this.panel15);
            this.panel1.Controls.Add(this.panel7);
            this.panel1.Controls.Add(this.panel4);
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Dock = DockStyle.Top;
            this.panel1.Location = new Point(0, 8);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x313, 0x1a);
            this.panel1.TabIndex = 1;
            this.panel24.Controls.Add(this.pic_Help);
            this.panel24.Dock = DockStyle.Right;
            this.panel24.Location = new Point(0xe7, 3);
            this.panel24.Name = "panel24";
            this.panel24.Size = new Size(0x16, 20);
            this.panel24.TabIndex = 0x13;
            this.pic_Help.BackgroundImage = Resources.question11;
            this.pic_Help.Cursor = Cursors.Hand;
            this.pic_Help.Location = new Point(3, 2);
            this.pic_Help.Name = "pic_Help";
            this.pic_Help.Size = new Size(0x10, 0x10);
            this.pic_Help.TabIndex = 8;
            this.pic_Help.TabStop = false;
            this.pic_Help.Click += new EventHandler(this.pic_Help_Click);
            this.panel5.Controls.Add(this.btnAddNew);
            this.panel5.Dock = DockStyle.Right;
            this.panel5.Location = new Point(0xfd, 3);
            this.panel5.Name = "panel5";
            this.panel5.Size = new Size(0x59, 20);
            this.panel5.TabIndex = 0x12;
            this.btnAddNew.Dock = DockStyle.Right;
            this.btnAddNew.Location = new Point(14, 0);
            this.btnAddNew.Name = "btnAddNew";
            this.btnAddNew.Size = new Size(0x4b, 20);
            this.btnAddNew.TabIndex = 0;
            this.btnAddNew.Text = "新 增";
            this.btnAddNew.UseVisualStyleBackColor = true;
            this.btnAddNew.Click += new EventHandler(this.btnAddNew_Click);
            this.panel6.Controls.Add(this.btnSelectAll);
            this.panel6.Dock = DockStyle.Right;
            this.panel6.Location = new Point(0x156, 3);
            this.panel6.Name = "panel6";
            this.panel6.Size = new Size(0x59, 20);
            this.panel6.TabIndex = 0x11;
            this.btnSelectAll.Dock = DockStyle.Right;
            this.btnSelectAll.Location = new Point(14, 0);
            this.btnSelectAll.Name = "btnSelectAll";
            this.btnSelectAll.Size = new Size(0x4b, 20);
            this.btnSelectAll.TabIndex = 0;
            this.btnSelectAll.Text = "全 选";
            this.btnSelectAll.UseVisualStyleBackColor = true;
            this.btnSelectAll.Click += new EventHandler(this.btnSelectAll_Click);
            this.panel14.Controls.Add(this.btnChongAll);
            this.panel14.Dock = DockStyle.Right;
            this.panel14.Location = new Point(0x1af, 3);
            this.panel14.Name = "panel14";
            this.panel14.Size = new Size(0x59, 20);
            this.panel14.TabIndex = 0x10;
            this.btnChongAll.Dock = DockStyle.Right;
            this.btnChongAll.Location = new Point(14, 0);
            this.btnChongAll.Name = "btnChongAll";
            this.btnChongAll.Size = new Size(0x4b, 20);
            this.btnChongAll.TabIndex = 0;
            this.btnChongAll.Text = "重 选";
            this.btnChongAll.UseVisualStyleBackColor = true;
            this.btnChongAll.Click += new EventHandler(this.btnChongAll_Click);
            this.panel15.Controls.Add(this.btnDelele);
            this.panel15.Dock = DockStyle.Right;
            this.panel15.Location = new Point(520, 3);
            this.panel15.Name = "panel15";
            this.panel15.Size = new Size(0x59, 20);
            this.panel15.TabIndex = 15;
            this.btnDelele.Dock = DockStyle.Right;
            this.btnDelele.Location = new Point(14, 0);
            this.btnDelele.Name = "btnDelele";
            this.btnDelele.Size = new Size(0x4b, 20);
            this.btnDelele.TabIndex = 0;
            this.btnDelele.Text = "删 除";
            this.btnDelele.UseVisualStyleBackColor = true;
            this.btnDelele.Click += new EventHandler(this.btnDelele_Click);
            this.panel7.Controls.Add(this.btn_Check);
            this.panel7.Dock = DockStyle.Right;
            this.panel7.Location = new Point(0x261, 3);
            this.panel7.Name = "panel7";
            this.panel7.Size = new Size(0x59, 20);
            this.panel7.TabIndex = 14;
            this.btn_Check.Dock = DockStyle.Right;
            this.btn_Check.Location = new Point(14, 0);
            this.btn_Check.Name = "btn_Check";
            this.btn_Check.Size = new Size(0x4b, 20);
            this.btn_Check.TabIndex = 1;
            this.btn_Check.Text = "确 认";
            this.btn_Check.UseVisualStyleBackColor = true;
            this.btn_Check.Click += new EventHandler(this.btn_Check_Click);
            this.panel4.Controls.Add(this.btn_ChengDan);
            this.panel4.Dock = DockStyle.Right;
            this.panel4.Location = new Point(0x2ba, 3);
            this.panel4.Name = "panel4";
            this.panel4.Size = new Size(0x59, 20);
            this.panel4.TabIndex = 2;
            this.btn_ChengDan.Dock = DockStyle.Right;
            this.btn_ChengDan.Location = new Point(14, 0);
            this.btn_ChengDan.Name = "btn_ChengDan";
            this.btn_ChengDan.Size = new Size(0x4b, 20);
            this.btn_ChengDan.TabIndex = 2;
            this.btn_ChengDan.Text = "成 单";
            this.btn_ChengDan.UseVisualStyleBackColor = true;
            this.btn_ChengDan.Click += new EventHandler(this.btn_ChengDan_Click);
            this.panel3.Dock = DockStyle.Bottom;
            this.panel3.Location = new Point(0, 0x17);
            this.panel3.Name = "panel3";
            this.panel3.Size = new Size(0x313, 3);
            this.panel3.TabIndex = 1;
            this.panel2.Dock = DockStyle.Top;
            this.panel2.Location = new Point(0, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new Size(0x313, 3);
            this.panel2.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x329, 0x201);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(0x327, 0x200);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.DataGridList);
            this.pan_AllPlanes.Controls.Add(this.panel13);
            this.pan_AllPlanes.Controls.Add(this.panel10);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Controls.Add(this.panel8);
            this.pan_AllPlanes.Controls.Add(this.panel1);
            this.pan_AllPlanes.Controls.Add(this.pan_TopJianGe);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(0x313, 0x1ec);
            this.pan_AllPlanes.TabIndex = 4;
            this.DataGridList.AllowUserToAddRows = false;
            this.DataGridList.AllowUserToDeleteRows = false;
            style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style.BackColor = Color.FromArgb(0xf9, 0xf9, 0xf9);
            this.DataGridList.AlternatingRowsDefaultCellStyle = style;
            this.DataGridList.BackgroundColor = Color.WhiteSmoke;
            this.DataGridList.BorderStyle = BorderStyle.None;
            style2.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style2.BackColor = Color.White;
            style2.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style2.ForeColor = SystemColors.WindowText;
            style2.SelectionBackColor = SystemColors.Highlight;
            style2.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.ColumnHeadersDefaultCellStyle = style2;
            this.DataGridList.Columns.AddRange(new DataGridViewColumn[] { this.chk_chkItem, this.TestDunkId, this.TestDunkNum, this.GuestName, this.UserId, this.CreateTime, this.Prices, this.IsSucceed, this.IsCheck, this.imgEdit, this.imgDelete });
            style3.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style3.BackColor = SystemColors.Window;
            style3.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style3.ForeColor = SystemColors.ControlText;
            style3.SelectionBackColor = SystemColors.Highlight;
            style3.SelectionForeColor = SystemColors.HighlightText;
            style3.WrapMode = DataGridViewTriState.False;
            this.DataGridList.DefaultCellStyle = style3;
            this.DataGridList.Dock = DockStyle.Fill;
            this.DataGridList.EnableHeadersVisualStyles = false;
            this.DataGridList.GridColor = Color.FromArgb(0xab, 0xb9, 0x9d);
            this.DataGridList.Location = new Point(0, 0x2a);
            this.DataGridList.Name = "DataGridList";
            style4.Alignment = DataGridViewContentAlignment.BottomCenter;
            style4.BackColor = Color.White;
            style4.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            style4.ForeColor = SystemColors.WindowText;
            style4.SelectionBackColor = SystemColors.Highlight;
            style4.SelectionForeColor = SystemColors.HighlightText;
            this.DataGridList.RowHeadersDefaultCellStyle = style4;
            style5.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.DataGridList.RowsDefaultCellStyle = style5;
            this.DataGridList.RowTemplate.Height = 0x17;
            this.DataGridList.Size = new Size(0x313, 0x199);
            this.DataGridList.TabIndex = 7;
            this.DataGridList.CellDoubleClick += new DataGridViewCellEventHandler(this.DataGridList_CellDoubleClick);
            this.DataGridList.CellClick += new DataGridViewCellEventHandler(this.DataGridList_CellClick);
            style6.NullValue = false;
            this.chk_chkItem.DefaultCellStyle = style6;
            this.chk_chkItem.HeaderText = "选项";
            this.chk_chkItem.IndeterminateValue = "";
            this.chk_chkItem.Name = "chk_chkItem";
            this.chk_chkItem.Width = 50;
            this.chk_chkItem.FalseValue = "false";
            this.chk_chkItem.TrueValue = "true";
            this.TestDunkId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.TestDunkId.DataPropertyName = "TestDunkId";
            style7.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style7.BackColor = Color.White;
            this.TestDunkId.DefaultCellStyle = style7;
            this.TestDunkId.HeaderText = "试泡id";
            this.TestDunkId.Name = "TestDunkId";
            this.TestDunkId.ReadOnly = true;
            this.TestDunkId.Visible = false;
            this.TestDunkNum.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.TestDunkNum.DataPropertyName = "TestDunkNum";
            style8.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style8.BackColor = Color.White;
            this.TestDunkNum.DefaultCellStyle = style8;
            this.TestDunkNum.HeaderText = "单据编号";
            this.TestDunkNum.Name = "TestDunkNum";
            this.TestDunkNum.ReadOnly = true;
            this.GuestName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.GuestName.DataPropertyName = "GuestName";
            style9.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style9.BackColor = Color.White;
            this.GuestName.DefaultCellStyle = style9;
            this.GuestName.HeaderText = "客人名称";
            this.GuestName.Name = "GuestName";
            this.GuestName.ReadOnly = true;
            this.UserId.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.UserId.DataPropertyName = "UserId";
            style10.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style10.BackColor = Color.White;
            this.UserId.DefaultCellStyle = style10;
            this.UserId.HeaderText = "试泡人";
            this.UserId.Name = "UserId";
            this.UserId.ReadOnly = true;
            this.CreateTime.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.CreateTime.DataPropertyName = "CreateTime";
            style11.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style11.BackColor = Color.White;
            this.CreateTime.DefaultCellStyle = style11;
            this.CreateTime.HeaderText = "试泡时间";
            this.CreateTime.Name = "CreateTime";
            this.CreateTime.ReadOnly = true;
            this.Prices.DataPropertyName = "Prices";
            this.Prices.HeaderText = "成本价";
            this.Prices.Name = "Prices";
            this.IsSucceed.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            this.IsSucceed.DataPropertyName = "IsSucceed";
            style12.Alignment = DataGridViewContentAlignment.MiddleCenter;
            style12.BackColor = Color.White;
            this.IsSucceed.DefaultCellStyle = style12;
            this.IsSucceed.HeaderText = "是否成单";
            this.IsSucceed.Name = "IsSucceed";
            this.IsSucceed.ReadOnly = true;
            this.IsCheck.DataPropertyName = "IsCheck";
            this.IsCheck.HeaderText = "是否确认";
            this.IsCheck.Name = "IsCheck";
            this.imgEdit.HeaderText = "编辑";
            this.imgEdit.Image = Resources.EditBtn;
            this.imgEdit.Name = "imgEdit";
            this.imgEdit.Width = 60;
            this.imgDelete.HeaderText = "删除";
            this.imgDelete.Image = Resources.DeleteBtn;
            this.imgDelete.Name = "imgDelete";
            this.imgDelete.Width = 60;
            this.panel13.Dock = DockStyle.Bottom;
            this.panel13.Location = new Point(0, 0x1c3);
            this.panel13.Name = "panel13";
            this.panel13.Size = new Size(0x313, 10);
            this.panel13.TabIndex = 5;
            this.panel10.BackColor = Color.FromArgb(0xca, 0xc9, 0xce);
            this.panel10.Controls.Add(this.panel12);
            this.panel10.Controls.Add(this.panel11);
            this.panel10.Dock = DockStyle.Bottom;
            this.panel10.Location = new Point(0, 0x1cd);
            this.panel10.Name = "panel10";
            this.panel10.Size = new Size(0x313, 0x1a);
            this.panel10.TabIndex = 4;
            this.panel12.Controls.Add(this.lblWhere);
            this.panel12.Dock = DockStyle.Fill;
            this.panel12.Location = new Point(0, 0);
            this.panel12.Name = "panel12";
            this.panel12.Size = new Size(0x156, 0x1a);
            this.panel12.TabIndex = 1;
            this.lblWhere.AutoSize = true;
            this.lblWhere.Dock = DockStyle.Right;
            this.lblWhere.Location = new Point(0x156, 0);
            this.lblWhere.Name = "lblWhere";
            this.lblWhere.Size = new Size(0, 12);
            this.lblWhere.TabIndex = 0;
            this.lblWhere.Visible = false;
            this.panel11.Controls.Add(this.navigator_Page);
            this.panel11.Dock = DockStyle.Right;
            this.panel11.Location = new Point(0x156, 0);
            this.panel11.Name = "panel11";
            this.panel11.Size = new Size(0x1bd, 0x1a);
            this.panel11.TabIndex = 0;
            this.navigator_Page.Dock = DockStyle.Bottom;
            this.navigator_Page.Location = new Point(0, 8);
            this.navigator_Page.Name = "navigator_Page";
            this.navigator_Page.PageSize = 20;
            this.navigator_Page.RowCount = 0;
            this.navigator_Page.Size = new Size(0x1bd, 0x12);
            this.navigator_Page.TabIndex = 0;
            this.navigator_Page.OnLoadViewStatus += new Navigator.LoadViewStatusHandler(this.navigator_Page_OnLoadViewStatus);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x1e7);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(0x313, 5);
            this.panel9.TabIndex = 3;
            this.panel8.Dock = DockStyle.Top;
            this.panel8.Location = new Point(0, 0x22);
            this.panel8.Name = "panel8";
            this.panel8.Size = new Size(0x313, 8);
            this.panel8.TabIndex = 2;
            this.pan_TopJianGe.Dock = DockStyle.Top;
            this.pan_TopJianGe.Location = new Point(0, 0);
            this.pan_TopJianGe.Name = "pan_TopJianGe";
            this.pan_TopJianGe.Size = new Size(0x313, 8);
            this.pan_TopJianGe.TabIndex = 0;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x31d, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x1ec);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x1ec);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x1f6);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x327, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x327, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x200);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(0x327, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x328, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x201);
            this.pan_DockRight.TabIndex = 1;
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x201);
            this.pan_DockLeft.TabIndex = 0;
            this.label1.AutoSize = true;
            this.label1.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.label1.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.label1.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.label1.Location = new Point(6, 8);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x5b, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "茶叶试泡管理";
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x329, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.label1);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x305, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x324, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x329, 0x221);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = FormBorderStyle.None;
            base.Name = "FrmTestDunkList";
            this.Text = "FrmChain";
            base.Load += new EventHandler(this.FrmTestDunkList_Load);
            this.panel1.ResumeLayout(false);
            this.panel24.ResumeLayout(false);
            ((ISupportInitialize) this.pic_Help).EndInit();
            this.panel5.ResumeLayout(false);
            this.panel6.ResumeLayout(false);
            this.panel14.ResumeLayout(false);
            this.panel15.ResumeLayout(false);
            this.panel7.ResumeLayout(false);
            this.panel4.ResumeLayout(false);
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            ((ISupportInitialize) this.DataGridList).EndInit();
            this.panel10.ResumeLayout(false);
            this.panel12.ResumeLayout(false);
            this.panel12.PerformLayout();
            this.panel11.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void InitPage()
        {
            this.navigator_Page.PageSize = PublicAppliction.PageCount;
            this.navigator_Page.DataContainer = this.DataGridList;
            this.navigator_Page.Init();
        }

        private void navigator_Page_OnLoadViewStatus()
        {
            this.DataGrid_bind();
            this.navigator_Page.PageSize = PublicAppliction.PageCount;
            this.navigator_Page.DataContainer = this.DataGridList;
            this.navigator_Page.DataBind();
        }

        private void pic_Help_Click(object sender, EventArgs e)
        {
            new FrmHelp(11).Show();
        }
    }
}

